<template>
  <div class="charts" ref="charts">

  </div>
</template>

<script>
import * as echarts from 'echarts';
export default {
  name: 'progressChart',
  mounted() {
    let lineCharts = echarts.init(this.$refs.charts)
    let options = {
      xAxis: {
        show: false,
        min: 0,
        max: 100
      },
      yAxis: {
        show: false,
        type: 'category'
      },
      series: [
        {
          data: [78],
          type: 'bar',
          barWidth: 10,
          color: 'yellowgreen',
          // 背景颜色设置
          showBackground: true,
          backgroundStyle: {
            color: '#ccc'
          },
          // 文本标签
          label: {
            show: true,
            formatter: '|',
            // 文本标签位置调试
            position: 'right'
          }
        },

      ],
      grid: {
        left: 0,
        right: 0,
        top: 0,
        bottom: 0,
      },
    }

    lineCharts.setOption(options)


  },

}
</script>

<style scoped>
.charts {
  width: 100%;
  height: 100%;

}
</style>
